﻿using System.Collections;
using System.Collections.Generic;
using System.Net;
using UnityEngine;

public class CoroutineManager : MonoBehaviour
{

    private static CoroutineManager _instance; 
    
    public static CoroutineManager Instance
    {
        get
        {
            if (_instance == null)
            {
                var go = new GameObject {name = "_coroutineManager"};
                
                DontDestroyOnLoad(go);
                _instance = go.AddComponent<CoroutineManager>();
                Instantiate(go);
            }

            return _instance;
        }
    }

    public void StartCoroutine(Coroutine coroutineMethond)
    {
        StartCoroutine(coroutineMethond);
    }

}
